'''
#输出九九乘法表(外循环控行数，内循环控列数)
for i in range(1,10):
   for j in range(1,i+1):
       print('{}*{}={:<4}'.format(j,i,j*i),end=" ")

   print("")
print("="*64)
       
#输出九九乘法表
for i in range(9,0,-1):
   for j in range(1,i+1):
       print('{}*{}={:<4}'.format(j,i,j*i),end=" ")
      
   print("")
       


#输出九九乘法表(外循环控行数，内循环控列数)
for i in range(1,10):
   for n in range(i,10-1):
       print(" "*8,end=" ")
   for j in range(i,0,-1):
       print('{}*{}={:<4}'.format(j,i,j*i),end=" ")
   print("")
print("="*64)
   
#输出九九乘法表
for i in range(9,0,-1):
   for n in range(i,10-1):
       print(" "*8,end=" ") 
   for j in range(i,0,-1):
       print ('{}*{}={:<4}'.format(j,i,j*i),end=" ")
 
   print("")
       
'''

i=1

while i<10:
    j=1
    while j<=i:
        print('{}*{}={:<4}'.format(j,i,j*i),end=" ")
        j=j+1
    i=i+1
    print("")
print("="*64)
    
#输出九九乘法表
i=9
while i>0:
   j=1
   while j<=i:
       print('{}*{}={:<4}'.format(j,i,j*i),end=" ")
       j=j+1
   i=i-1   
   print("")




#输出九九乘法表(外循环控行数，内循环控列数)

i=1
while i<10:
   n=i
   j=i
   while n<9:
       print(" "*8,end=" ")
       n=n+1
   while j>=1:
       print('{}*{}={:<4}'.format(j,i,j*i),end=" ")
       j=j-1
   i=i+1
   print("")
print("="*64)


   
#输出九九乘法表
i=9
while i>0:
    n=i
    while n<9:
       print(" "*8,end=" ")
       n=n+1
    j=i
    while j>=1:
       print ('{}*{}={:<4}'.format(j,i,j*i),end=" ")
       j=j-1
    i=i-1
   
    print("")
   
